package com.zhouyu.paydemo.unipay.qrcode.controller;

import com.zhouyu.paydemo.unipay.qrcode.BS.ApplyQrNo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Description:被扫
 *
 * @author zhouyu
 * @create 2020/8/20
 */
@RestController
@RequestMapping("/unipay")
public class BsQrController {

    @Autowired
    ApplyQrNo applyQrNo;

    @PostMapping("/qrcode")
    public void getQrcode(HttpServletResponse response){
        try {
            applyQrNo.applyQrcode(response);
        } catch (ServletException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @PostMapping("/recall")
    public void getRecall(HttpServletResponse response){
        try {
            applyQrNo.applyQrcode(response);
        } catch (ServletException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}